// ==UserScript==
// @name         修改页面标题
// @namespace    http://tampermonkey.net/
// @version      2024-08-28
// @description  try to take over the world!
// @author       You
// @match        http://mginternational.stc1518.com/
// @match        https://mjsapph5.sootoken.com.cn/
// @match        https://slbstg.stc1518.com/dcfzt/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org
// @grant        GM_log
// @grant        unsafeWindow
// @grant        GM_setValue
// @grant        GM_xmlhttpRequest
// @updateURL    https://gitee.com/yldream/editTitle/blob/master/editTitle.js

// ==/UserScript==

(function() {
    'use strict';

    //const target = document.querySelector('title');
    var brandName = 'test';
    // 获取当前页面的URL
    var currentUrl = window.location.href;
    console.info(">>>>>>>>>>>>>>>>");
    console.info(currentUrl);
    if (currentUrl.match("mjsapph5")) {
        brandName='prod';
        console.info("生产环境");
    } else if (currentUrl.match("mginternational")) {
        brandName='test';
        console.info("测试环境");
    }else if (currentUrl.match("slbstg.stc1518")) {
        brandName='中台test';
        console.info("测试环境");
    }
    document.title = brandName;
    // 创建一个observer实例
    //const observer = new MutationObserver(function() {
    //    if (document.title !== brandName) {
    //        document.title = brandName;
    //    }
    //});

    // Observer的配置
    //const config = {subtree: true, characterData: true, childList: true};

    // 完成Observer的实现
   // observer.observe(target, config);

})();